home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Complementary Applications 2004 February / SGI IRIX 6.5 Complementary Applications 2004 February.iso / dist / cde.idb / usr / dt / share / include / Xm / TextStrSoP.h.z / TextStrSoP.h
Encoding:
C/C++ Source or Header  |  2003-11-18  |  9.0 KB  |  290 lines

  1. /*
  2.  * TextStrSoP.h
  3.  *
  4.  * Copyright 2000, Silicon Graphics, Inc.
  5.  * ALL RIGHTS RESERVED
  6.  * 
  7.  * UNPUBLISHED -- Rights reserved under the copyright laws of the United
  8.  * States.   Use of a copyright notice is precautionary only and does not
  9.  * imply publication or disclosure.
  10.  *
  11.  * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
  12.  * Use, duplication or disclosure by the Government is subject to restrictions
  13.  * as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
  14.  * in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
  15.  * in similar or successor clauses in the FAR, or the DOD or NASA FAR
  16.  * Supplement.  Contractor/manufacturer is Silicon Graphics, Inc.,
  17.  * 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
  18.  *
  19.  * THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
  20.  * INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
  21.  * DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
  22.  * PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
  23.  * GRAPHICS, INC.
  24.  */
  25. /* 
  26.  * @OSF_COPYRIGHT@
  27.  * (c) Copyright 1990, 1991, 1992, 1993, 1994 OPEN SOFTWARE FOUNDATION, INC.
  28.  * ALL RIGHTS RESERVED
  29.  *  
  30. */ 
  31. /*
  32.  * HISTORY
  33.  * Motif Release 1.2.5
  34. */
  35. /*   $XConsortium: TextStrSoP.h /main/cde1_maint/2 1995/08/18 19:29:09 drk $ */
  36. /*
  37. *  (c) Copyright 1989, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
  38. /*
  39. *  (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 HEWLETT-PACKARD COMPANY */
  40. #ifndef _XmTextStrSoP_h
  41. #define _XmTextStrSoP_h
  42.  
  43. #include <Xm/XmP.h>
  44. #include <Xm/Text.h>
  45.  
  46. #ifdef __cplusplus
  47. extern "C" {
  48. #endif
  49.  
  50. /****************************************************************
  51.  *
  52.  * Definitions for use by sources and source users.
  53.  *
  54.  ****************************************************************/
  55.  
  56. typedef enum {EditDone, EditError, EditReject} XmTextStatus;
  57.  
  58. typedef enum {XmsdLeft, XmsdRight} XmTextScanDirection;
  59.     
  60. typedef struct _XmSourceDataRec {
  61.     XmTextSource source;    /* Backpointer to source record. */
  62.     XmTextWidget *widgets;    /* Array of widgets displaying this source. */
  63.     XmTextPosition left, right; /* Left and right extents of selection. */
  64.     char * ptr;            /* Actual string data. */
  65.     char * value;        /* Value of the string data. */
  66.     char * gap_start;        /* Gapped buffer start pointer */
  67.     char * gap_end;        /* Gapped buffer end pointer */
  68.     char * PSWC_NWLN;           /* Holder for char*, short*, int* rep of NWLN */
  69.     int length;            /* Number of chars of data. */
  70.     int maxlength;        /* Space allocated. */
  71.     int old_length;        /* Space allocated for value pointer. */
  72.     int numwidgets;        /* Number of entries in above. */
  73.     int maxallowed;        /* The user is not allowed to grow source */
  74.                 /* to a size greater than this. */
  75.     Time prim_time;             /* time of primary selection */
  76.     Boolean hasselection;    /* Whether we own the selection. */
  77.     Boolean editable;        /* Whether we allow any edits. */
  78. } XmSourceDataRec, *XmSourceData;
  79.  
  80. #ifdef _NO_PROTO
  81. typedef void (*AddWidgetProc)(); /* source, widget */
  82. #else
  83. typedef void (*AddWidgetProc)(
  84.             XmTextSource,
  85.             XmTextWidget);
  86. #endif
  87.  
  88. #ifdef _NO_PROTO
  89. typedef int (*CountLinesProc)(); /* source, start, length */
  90. #else
  91. typedef int (*CountLinesProc)(
  92.              XmTextSource,
  93.              XmTextPosition,
  94.              unsigned long);
  95. #endif
  96.  
  97. #ifdef _NO_PROTO
  98. typedef void (*RemoveWidgetProc)(); /* source, widget */
  99. #else
  100. typedef void (*RemoveWidgetProc)(
  101.             XmTextSource,
  102.             XmTextWidget);
  103. #endif
  104.  
  105. #ifdef _NO_PROTO
  106. typedef XmTextPosition (*ReadProc)(); /* source, position,
  107.                      last_position, block */
  108. #else
  109. typedef XmTextPosition (*ReadProc)(
  110.             XmTextSource,
  111.             XmTextPosition,    /* starting position */
  112.             XmTextPosition,    /* The last position we're interested in.
  113.                       Don't return info about any later
  114.                    positions. */
  115.             XmTextBlock);    /* RETURN: text read in */
  116. #endif
  117.  
  118. #ifdef _NO_PROTO
  119. typedef XmTextStatus (*ReplaceProc)(); /* initiator, event, start, end, block,
  120.                       call_callback */
  121. #else
  122. typedef XmTextStatus (*ReplaceProc)(
  123.             XmTextWidget,
  124.         XEvent *,
  125.             XmTextPosition *,
  126.             XmTextPosition *,
  127.             XmTextBlock,
  128. #if NeedWidePrototypes
  129.                 int);
  130. #else
  131.             Boolean);
  132. #endif /* NeedsWidePrototypes */
  133. #endif
  134.  
  135. #ifdef _NO_PROTO
  136. typedef XmTextPosition (*ScanProc)(); /* source, pos, sType, dir, 
  137.                      count, include */
  138. #else
  139. typedef XmTextPosition (*ScanProc)(
  140.             XmTextSource,
  141.             XmTextPosition,
  142.             XmTextScanType,
  143.             XmTextScanDirection,    /* Either XmsdLeft or XmsdRight. */
  144.             int,
  145. #if NeedWidePrototypes
  146.                 int);
  147. #else
  148.             Boolean);
  149. #endif /* NeedsWidePrototypes */
  150. #endif
  151.  
  152. #ifdef _NO_PROTO
  153. typedef Boolean (*GetSelectionProc)(); /* source, left, right */
  154. #else
  155. typedef Boolean (*GetSelectionProc)(
  156.             XmTextSource,
  157.             XmTextPosition *,
  158.             XmTextPosition *);
  159. #endif
  160.  
  161. #ifdef _NO_PROTO
  162. typedef void (*SetSelectionProc)(); /* source, left, right, time */
  163. #else
  164. typedef void (*SetSelectionProc)(
  165.             XmTextSource,
  166.             XmTextPosition,
  167.             XmTextPosition,
  168.             Time);
  169. #endif
  170.  
  171.  
  172. typedef struct _XmTextSourceRec {
  173.     struct _XmSourceDataRec *data;   /* Source-defined data (opaque type). */
  174.     AddWidgetProc    AddWidget;
  175.     CountLinesProc    CountLines;
  176.     RemoveWidgetProc    RemoveWidget;
  177.     ReadProc        ReadSource;
  178.     ReplaceProc        Replace;
  179.     ScanProc        Scan;
  180.     GetSelectionProc    GetSelection;
  181.     SetSelectionProc    SetSelection;
  182. } XmTextSourceRec;
  183.  
  184.  
  185. /********    Private Function Declarations    ********/
  186. #ifdef _NO_PROTO
  187.  
  188. extern char * _XmStringSourceGetString() ;
  189. extern Boolean _XmTextFindStringBackwards() ;
  190. extern Boolean _XmTextFindStringForwards() ;
  191. extern Boolean _XmStringSourceFindString() ;
  192. extern void _XmStringSourceSetGappedBuffer() ;
  193. extern Boolean _XmTextModifyVerify() ;
  194. extern XmTextSource _XmStringSourceCreate() ;
  195. extern void _XmStringSourceDestroy() ;
  196. extern char * _XmStringSourceGetValue() ;
  197. extern void _XmStringSourceSetValue() ;
  198. extern Boolean _XmStringSourceHasSelection() ;
  199. extern Boolean _XmStringSourceGetEditable() ;
  200. extern void _XmStringSourceSetEditable() ;
  201. extern int _XmStringSourceGetMaxLength() ;
  202. extern void _XmStringSourceSetMaxLength() ;
  203. extern void _XmTextValueChanged();
  204. #else
  205.  
  206. extern char * _XmStringSourceGetString( 
  207.                         XmTextWidget tw,
  208.                         XmTextPosition from,
  209.                         XmTextPosition to,
  210. #if NeedWidePrototypes
  211.                         int want_wchar) ;
  212. #else
  213.                         Boolean want_wchar) ;
  214. #endif /* NeedWidePrototypes */
  215. extern Boolean _XmTextFindStringBackwards( 
  216.                         Widget w,
  217.                         XmTextPosition start,
  218.                         char *search_string,
  219.                         XmTextPosition *position) ;
  220. extern Boolean _XmTextFindStringForwards( 
  221.                         Widget w,
  222.                         XmTextPosition start,
  223.                         char *search_string,
  224.                         XmTextPosition *position) ;
  225. extern Boolean _XmStringSourceFindString( 
  226.                         Widget w,
  227.                         XmTextPosition start,
  228.                         char *string,
  229.                         XmTextPosition *position) ;
  230. extern void _XmStringSourceSetGappedBuffer( 
  231.                         XmSourceData data,
  232.                         XmTextPosition position) ;
  233. extern Boolean _XmTextModifyVerify(
  234.             XmTextWidget initiator,
  235.                 XEvent *event,
  236.                 XmTextPosition *start,
  237.                 XmTextPosition *end,
  238.                 XmTextPosition *cursorPos,
  239.                 XmTextBlock block,
  240.                 XmTextBlock newblock,
  241.             Boolean *freeBlock) ;
  242. extern XmTextSource _XmStringSourceCreate( 
  243.                         char *value,
  244. #if NeedWidePrototypes
  245.                         int is_wchar) ;
  246. #else
  247.                         Boolean is_wchar) ;
  248. #endif /* NeedWidePrototypes */
  249. extern void _XmStringSourceDestroy( 
  250.                         XmTextSource source) ;
  251. extern char * _XmStringSourceGetValue( 
  252.                         XmTextSource source,
  253. #if NeedWidePrototypes
  254.                         int want_wchar) ;
  255. #else
  256.                         Boolean want_wchar) ;
  257. #endif /* NeedWidePrototypes */
  258. extern void _XmStringSourceSetValue( 
  259.                         XmTextWidget widget,
  260.                         char *value) ;
  261. extern Boolean _XmStringSourceHasSelection( 
  262.                         XmTextSource source) ;
  263. extern Boolean _XmStringSourceGetEditable( 
  264.                         XmTextSource source) ;
  265. extern void _XmStringSourceSetEditable( 
  266.                         XmTextSource source,
  267. #if NeedWidePrototypes
  268.                         int editable) ;
  269. #else
  270.                         Boolean editable) ;
  271. #endif /* NeedWidePrototypes */
  272. extern int _XmStringSourceGetMaxLength( 
  273.                         XmTextSource source) ;
  274. extern void _XmStringSourceSetMaxLength( 
  275.                         XmTextSource source,
  276.                         int max) ;
  277. extern void _XmTextValueChanged(XmTextWidget initiator,
  278.                 XEvent *event);
  279.  
  280. #endif /* _NO_PROTO */
  281. /********    End Private Function Declarations    ********/
  282.  
  283.  
  284. #ifdef __cplusplus
  285. }  /* Close scope of 'extern "C"' declaration which encloses file. */
  286. #endif
  287.  
  288. #endif /*  _XmTextStrSoP_h */
  289. /* DON'T ADD ANYTHING AFTER THIS #endif */
  290.